# -*- coding: utf-8 -*-
import scrapy
from movie.items import MovieItem

class MeijuSpider(scrapy.Spider):
    name = 'meiju'
    allowed_domains = ['meijutt.com']
    start_urls = ['https://www.meijutt.com/new100.html']

    def parse(self, response):

        #movies=response.xpath('//ul[@class=''top-list fn-clear'']/li')
        movies=response.xpath('//ul[@class="top-list  fn-clear"]/li')
        for each_movie in movies:
            item=MovieItem()
            name=each_movie.xpath('./h5/a/@title').extract()[0]
            #item['name']=each_movie.xpath('./h5/a/text()').extract()[0]
            item['name']=name

            yield item

        '''
        movies = response.xpath('//meta[@name="renderer"]/title/text()').extract()[0]
        item = MovieItem()
        item['name'] = movies
        yield item
        '''


